diff --git a/callsearch.phtml b/callsearch.phtml index 9927862..8254cb1 100644 --- a/callsearch.phtml +++ b/callsearch.phtml @@ -1,106 +1,105 @@ "CDRTool_Session", "auth" => "CDRTool_Auth", "perm" => "CDRTool_Perm" ) ); - $loginname = $auth->auth["uname"]; $perm->check('callsearch'); $export = isset($_REQUEST['export']) ? $_REQUEST['export'] : ''; $cdr_source = isset($_REQUEST["cdr_source"]) ? $_REQUEST['cdr_source'] : ''; $trace = isset($_REQUEST["trace"])? $_REQUEST['trace'] : ''; $action = isset($_REQUEST["action"])? $_REQUEST['action'] : ''; $previous_page = isset($_REQUEST['previous_page']) ? $_REQUEST['previous_page'] : ''; require 'cdr_generic.php'; require 'rating.php'; set_time_limit(1800); if (!$export) { $title="CDRTool call search "; if (is_readable("/etc/cdrtool/local/header.phtml")) { include '/etc/cdrtool/local/header.phtml'; } else { include 'header.phtml'; } if ($previous_page == 'license_page') { $db = new DB_CDRTool(); $query = sprintf( "insert into settings (billing_party, var_module,var_name,var_value) values ('%s','login','I_agree_with_license','True')", $auth->auth["uname"] ); $db->query($query); } } else { Header("Content-type: text/plain"); Header("Content-Disposition: inline; filename=cdr.txt"); } if (isset($CDRTool['dataSourcesAllowed'])) { - while (list($k,$v) = each($CDRTool['dataSourcesAllowed'])) { + foreach ($CDRTool['dataSourcesAllowed'] as $k => $v) { $cdr_source_els[] = array( "label" => $DATASOURCES[$v]['name'], "value" => $v ); } if (!$cdr_source) { $cdr_source = $cdr_source_els[0]['value']; } } $CDR_class = $DATASOURCES[$cdr_source]["class"]; if (!$export && !$trace) { $layout = new pageLayoutLocal(); if ($CDRTool['filter']['aNumber']) { $layout->showHeader(); $layout->showTopMenuSubscriber(); } else { $layout->showTopMenu(); } } if (is_array($DATASOURCES[$cdr_source])) { if (class_exists($CDR_class)) { $CDRS = new $CDR_class($cdr_source); if ($action =='edit' || !$action) { if ($CDRTool['filter']['aNumber']) { $CDRS->searchFormSubscriber(); } else { $CDRS->searchForm(); } - } elseif ($action == search) { + } elseif ($action == 'search') { $CDRS->show(); } if (!$export && !$trace) { $layout->showFooter(); } } else { $log = sprintf("Error initializing datasource '%s', class '%s' is not defined", $cdr_source, $CDR_class); print "
$log
"; } } else { $log = sprintf("Error: datasource '%s' is not defined", $cdr_source); print "$log
"; } if (!$export && !$trace) { print "